#include "../source/db.hpp"

#define HOST "127.0.0.1"
#define USER "root"
#define PASS "15206962723Li"
#define DBNAME "gobang"
#define PORT 3306

int main()
{
    liang::userTable user(HOST, USER, PASS, DBNAME, PORT);
    Json::Value usr;
    usr["username"] = "xiaoming";
    usr["password"] = "123123123x";
    // user.registration(usr);
    std::cout << user.login(usr) << std::endl;
    // Json::Value xm;
    // user.selectById(1, xm);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;

    // Json::Value XM;
    // user.selectByName("xiaoming", XM);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;

    // user.win(1);
    // xm;
    // user.selectById(1, xm);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;

    // XM;
    // user.selectByName("xiaoming", XM);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;

    // user.lose(1);
    // xm;
    // user.selectById(1, xm);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;

    // XM;
    // user.selectByName("xiaoming", XM);
    // std::cout << xm["id"] << " " << xm["username"] << " " << xm["score"] << " " << xm["total_count"] << " " << xm["win_count"] << std::endl;
    return 0;
}